<?php

namespace Common\Model;

class ImageModel extends XuecheModel {

    protected $pk = 'image_id';
    protected $tableName = 'image';
    protected $fields = array(
        'image_id','storage','image_name','url','l_url','m_ident','s_url','width','height','watermark','last_modified'
    );

    /**
     * 清空数据缓存
     * 
     */
    public function ClearAllCache() {
        
    }

    //缓存设置
    protected $_useCacheType = 'file';
    protected $_catheTime = 0;

    public function Validate($data) {
        return true;
    }

    public function GetDataById($id = 0, $field = null) {
        return parent::GetDataById($id, $field);
    }

    public function SaveData($data, $pks = array()) {
        return parent::SaveData($data, $pks);
    }


    public function GetCount($where) {
        $where = " 1=1 " . $where;
        return $this->where($where)->count($this->pk);
    }

}
